package JavaSEAdvance.day02_interface.d024_homework;

/**
 * @author Xiao
 * @date 2021/7/16
 */
public class Breeder {
    /**
     * 6.定义饲养员类:Breeder
     * 		行为:
     * 			饲养动物breed:包括吃饭和喝水
     */
    public void breeding (Animal a) {
        a.drink();
        a.eat();
        if (a instanceof Dog) {
            ((Dog) a).swimming();
        } else if (a instanceof Frog) {
            Frog f = (Frog)a;
            f.swimming();
        }
        System.out.println();
    }
}
